import { mock } from 'mockjs'
// 模拟数据
const data = mock({
  'tab|5': [{
    'title': '@ctitle(2)',
    'id': '@id',
    'children|3-6': [{
      'title': '@ctitle(2)',
      'url': '@image(100x100, @color)',
      'id': '@id',
    }]
  }],
  'tabList|5': [{
    'title': '@ctitle(2)',
    'id': '@id',
    'children|3-6': [{
      'title': '@ctitle',
      'url': '@image(100x100, @color)',
      'desc': '@cword(10,30)',
      'id': '@id',
    }]
  }]
})

//拦截请求
mock('/api/tab', 'get', () => {
  return {
    code: 200,
    data: data.tab
  }
})


mock('/api/tabList', 'get', () => {
  return {
    code: 200,
    data: data.tabList
  }
})